package com.yswee.mallnavi.entity.info;

import com.yswee.mallnavi.context.ContextConstant;
import com.yswee.mallnavi.entity.common.LetterEntity;

public class BrandEntity extends LetterEntity implements Comparable<BrandEntity> {

    public String id;
    public String name;
    public String pictureUrl;
    public String descrption;
    public String hDescrption;
    public String firstLetter;

    public String getDescription() {
        if (ContextConstant.IS_LANDSCAPE) {
            return hDescrption;
        } else {
            return descrption;
        }
    }

    public BrandEntity bottom;

    public boolean search(String keyword) {
        return (name != null && name.indexOf(keyword) >= 0);
    }

    @Override
    public int compareTo(BrandEntity another) {
        if(another == null) {
            return -1;
        }
        if(key.equals(another.key)) {
            return pinyin.compareTo(another.pinyin);
        } else {
            return key.compareTo(another.key);
        }
    }
}

